TreeMap

TreeMap

image.png

TreeMap與TreeSet相似,只是為雙列的形式
因此內部都是需要重寫compareTo方法來作為排序的基準

image.png
記得要實現Comparable接口
image.png